<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Cross Domain Query</title>
    <script src="./jquery-3.3.1.js"></script>
    <script src="./axios-0.18.0.js"></script>
</head>
<body>
ABC
</body>
<script type="text/javascript">
    $(function () {
        var token = '';

        var instance = axios.create({
            baseURL: 'http://springbootjwt.com:8080',
            headers: {
                'Access-Control-Allow-Origin':'*',
                'Access-Control-Allow-Headers':'Authorization,Origin, X-Requested-With, Content-Type, Accept',
                'Access-Control-Allow-Methods':'GET,POST,OPTIONS,PUT,DELETE'
            }
        });

        instance.get('/auth?name=yzc&pwd=abc')
            .then(function (response) {
                token = response.data.data;
                console.log("token = " + token);
                console.log(response);
            })
            .catch(function (error) {
                console.log(error);
            });

        /*instance.get('/users/1')
            .then(function (response) {
                console.log(response);
            })
            .catch(function (error) {
                console.log(error);
            });*/
    });
</script>
</html>